﻿using System;
using System.Net;
using System.Text;
using System.Web.Mvc;

using mvcForum.Web.Controllers;

namespace mvcForum.Web.Areas.ForumAPI.Controllers {

	public class HeadlineController : BaseAPIController {

		public ActionResult Read(String mode) {
			String data = String.Empty;
			try {
				WebClient client = new WebClient();
				client.Encoding = Encoding.UTF8;
				data = client.DownloadString("http://mvcforum.org/forumapi/json/forum/listlatesttopics/7?count=3");
			}
			catch {
				data = "[]";
			}
			return this.Content(data, "application/json", Encoding.UTF8);
		}
	}
}